# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname="libiscsi"
pkgver="1.19.0"
pkgrel=0
pkgdesc="iSCSI client library and utilities"
url="https://github.com/sahlberg/libiscsi"
arch="all"
license="LGPL-2.1-or-later GPL-2.0-or-later"
makedepends="autoconf automake libtool linux-headers"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc $pkgname-utils"
source="libiscsi-$pkgver.tar.gz::https://github.com/sahlberg/libiscsi/archive/$pkgver.tar.gz"
builddir="$srcdir/libiscsi-$pkgver"

prepare() {
	default_prepare
	autoreconf -vif
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--disable-werror
	make
}

check() {
	make check
}

package() {
	DESTDIR="$pkgdir" make install
}

utils() {
	pkgdesc="iSCSI client utilites"
	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

sha512sums="2c0e70b7ecf66204524e57edf557a014b5141a8819e5d663b6e50cb2e756fd634ae1db0b1ca6915444d80a9babd54a82619bdd98726d16d4eeaf7b3c89cf3d53  libiscsi-1.19.0.tar.gz"
